const { defineConfig } = require('@vue/cli-service');
const { hostname } = require('os');
const path = require('path')

module.exports = defineConfig({
  transpileDependencies: true,

  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      // 哪些文件自动引入，使用绝对路径
      // 需要用path.join来拼接完整路径
      patterns: [
        path.join(__dirname, './src/assets/styles/mixins.less'),
        path.join(__dirname, './src/assets/styles/variables.less')
      ]
    }
  },
  chainWebpack: (config) => {
    // config.module
    // .rule('image')
    // .use('url-loader')
    // .loader('url-loader')
    // .tap(options => Object.assign(options, { limit: 10000 }))

  },
  // 开启IP域名访问
  devServer: {
    historyApiFallback: true,
    allowedHosts: ['www.corho.com'],
  },
  configureWebpack: {
    externals: {
      qc: 'QC'
    }
  }
})
